<?php
include "includes/sesiones.php";
include "includes/comunes.php";
//busco el credito
$sql="select * from creditos where id=".$_GET['cre_id'];
$rescre= $consultar=  cons_ins($sql);
$regcre=mysql_fetch_array($rescre);

//busco datos del cliente
$sqlCli="select * from clientes where Dni=".trim($regcre['cliente']);
$rescli=  cons_ins($sqlCli);
$regcli=mysql_fetch_array($rescli);
//busco datos del cliente
$sqlCuo="select * from cuotasCredito where creditoId=".trim($regcre['id']);
$rescuo=  cons_ins($sqlCuo);


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Impresion de Comprobante</title>
<style type="text/css">
<!--
.Estilo1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.Estilo2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
.Estilo4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; }
-->
</style>
</head>

<body>
<table width="573" height="539" border="0" align="center">
  <tr style="border-top: 1px solid #666666">
    <td colspan="3" rowspan="3"><div align="center" class="Estilo1" >COMPROBANTE DE ALTA DE CREDITOS </div></td>
    <td height="22" colspan="2"><span class="Estilo2">Fecha Otorgamiento: <?php echo $regcre['fecha']?> </span></td>
  </tr>
  <tr>
    <td height="20" colspan="2"><span class="Estilo2">Usuario: <?php echo $_SESSION['Usuario']?></span></td>
  </tr>
  <tr>
    <td height="20" colspan="2"><span class="Estilo2">Credito N&ordm;: <?php echo $regcre['id']?></span> </td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td width="56" height="17" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">Monto</span></div></td>
    <td width="135" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">Cuotas</span></div></td>
    <td width="127" height="17" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">Imp. Cuotas </span></div></td>
    <td width="114" height="17" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">Cod. Autor. </span></div></td>
    <td width="119" height="17" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">DNI&ordm; Cliente</span> </div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="21" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">$ <?php echo $regcre['monto']?></span></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2"><?php echo $regcre['cuotas']?></span></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2">$ <?php echo obtener_monto_cuota($regcre['id'])?></span></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2"><?php echo $regcre['autorizacion']?></span></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center"><span class="Estilo2"><?php echo $regcre['cliente']?></span></div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="25" colspan="5" style="border-top: 1px double #666666"><span class="Estilo2">
      <div align="center"><strong>DATOS DEL SOLICITANTE  </strong></div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="15" colspan="4" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">Apellido y Nombre </div></td>
    <td height="15" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">DNI</div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="21" colspan="4" style="border-top: 1px solid #666666"><div align="center" class="Estilo2">&nbsp;<?php echo obtener_cliente($regcre['cliente'])?></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">&nbsp;<?php echo $regcre['cliente']?></div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="15" colspan="2" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">Dom. Calle  </div></td>
    <td height="15" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">N� </div></td>
    <td height="15" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">Piso</div></td>
    <td height="15" style="border-top: 1px solid #666666"><div align="center" class="Estilo4">Dpto. </div></td>
  </tr>
  <tr style="border-top: 1px solid #666666">
    <td height="21" colspan="2" style="border-top: 1px solid #666666"><div align="center" class="Estilo4"><?php echo $regcli['Calle']?></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center" class="Estilo4"><?php echo $regcli['Numero']?></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center" class="Estilo4"><?php echo $regcli['Piso']?></div></td>
    <td height="21" style="border-top: 1px solid #666666"><div align="center" class="Estilo4"><?php echo $regcli['Dpto']?></div></td>
  </tr>
  <tr bgcolor="#666666">
    <td height="23" colspan="5" style="border-top: 1px solid #666666; border-bottom:1px solid #666666"><div align="center"><span class="Estilo2"> DETALLE DE CUOTAS </span> </div></td>
  </tr>
  <tr>
      <td colspan="2" align="center" style="border-top: 1px solid #666666; border-bottom:1px solid #666666"><span class="Estilo2">Cuota  N&ordm; </span></td>
      <td colspan="2" align="center" style="border-top: 1px solid #666666; border-bottom:1px solid #666666"><span class="Estilo2">Fecha Vto.</span></td>
    <td align="center" style="border-top: 1px solid #666666; border-bottom:1px solid #666666"><span class="Estilo2">Monto</span></td>
  </tr>
    <?php
    while ($regcuo=mysql_fetch_array($rescuo)):
    ?>

    <tr>
      <td colspan="2" align="center"><span class="Estilo2"> <?php echo $regcuo['cuota']?></span></td>
      <td colspan="2" align="center"><span class="Estilo2"> <?php echo format_fec($regcuo['vencimiento'],"/")?></span></td>
    <td align="center"><span class="Estilo2"> $<?php echo $regcuo['capital']+$regcuo['intereses']?></span></td>
  </tr>
  <?php

  endwhile
  ?>
  <tr><td colspan="2"></tr>
  <tr>
      <td colspan="5" style="border-top: 1px solid #666666; border-bottom:1px solid #666666">
          <br></br><div align="center"><a onclick="window.print();"  style="width:200px; border-left: 300px;">
                <img src="images/imprimir.png" border="0" width="25px"/></a></div></td>
  </tr>
</table>
</body>
</html>
